package com.beney.ds.sorting.abs;

public abstract class AbstractSort {
  protected static void swap(Object[] arr, int i, int j) {
    Object t = arr[i];
    arr[i] = arr[j];
    arr[j] = t;
  }

  /**
   * @return true, if arr[i] < arr[j]
   */
  protected static boolean isLess(Comparable[] arr, int i, int j) {
    return arr[i].compareTo(arr[j]) < 0;
  }

  protected static boolean isLess(Comparable a, Comparable b) {
    return a.compareTo(b) < 0;
  }
}
